package research;

import java.util.List;

public class Vertex implements Comparable{
	final private String name;
	private List<Vertex> similarVertices;
	private long ts;
	
	public Vertex(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
	
	public List<Vertex> getSimilarVertices() {
		return similarVertices;
	}

	public void setSimilarVertices(List<Vertex> similarVertices) {
		this.similarVertices = similarVertices;
	}
	
	public long getTs() {
		return ts;
	}

	public void setTs(long ts) {
		this.ts = ts;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Vertex other = (Vertex) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return name;
	}
	
	public int compareTo(Object o)
	{
		return (this.name).compareTo(((Vertex)o).getName());
	}

	
}
